//
//  BKUserAuthRealInfoView.m
//  bestkeep
//
//  Created by windCould on 16/12/14.
//  Copyright © 2016年 utouu. All rights reserved.
//

#import "BKUserAuthRealInfoView.h"
#import "BKMyCommon.h"

@interface BKUserAuthRealInfoView ()

@property (nonatomic,strong)UILabel * nameLab;
@property (nonatomic,strong)UITextField * nameTexField;
@property (nonatomic,strong)UIView * bottomLine1;

@property (nonatomic,strong)UILabel * identifyCardLab;
@property (nonatomic,strong)UITextField * identifyNumTexField;
@property (nonatomic,strong)UIView * bottomLine2;

@end


@implementation BKUserAuthRealInfoView

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self setUpViews];
        
    }
    
    return  self;
}

#pragma mark =========================Function==============================

-(void)setRealNameStr:(NSString *)realNameStr
{
    _realNameStr = realNameStr;
    _nameTexField.text = _realNameStr;
}

-(void)setIdentifiCardStr:(NSString *)identifiCardStr
{
    _identifiCardStr = identifiCardStr;
    _identifyNumTexField.text = identifiCardStr;
}

#pragma mark =========================布局===================================

-(void)setUpViews
{
    
    _nameLab = [UILabel new];
    _nameLab.text = @"姓名:";
    _nameLab.textColor = RGBCOLOR(64, 64, 64, 1);
    _nameLab.font = [UIFont systemFontOfSize:15];
    [self addSubview:_nameLab];
    
    _nameTexField= [UITextField new];
    _nameTexField.placeholder = nil;
    _nameTexField.userInteractionEnabled = NO;
    _nameTexField.textColor = RGBCOLOR(178, 178, 178,1);
    _nameTexField.font = [UIFont systemFontOfSize:15];
    [self addSubview:_nameTexField];
    
    _bottomLine1 = [UIView new];
    _bottomLine1.backgroundColor = RGBCOLOR(242, 242, 242, 1);
    [self addSubview:_bottomLine1];
    
    _identifyCardLab = [UILabel new];
    _identifyCardLab.text = @"证件号:";
    _identifyCardLab.textColor = RGBCOLOR(64, 64, 64, 1);
    _identifyCardLab.font = [UIFont systemFontOfSize:15];
    [self addSubview:_identifyCardLab];
    
    _identifyNumTexField = [UITextField new];
    _identifyNumTexField.placeholder = nil;
    _identifyNumTexField.userInteractionEnabled = NO;
    _identifyNumTexField.textColor = RGBCOLOR(178, 178, 178, 1);
    _identifyNumTexField.font = [UIFont systemFontOfSize:15];
    _identifyNumTexField.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
    [self addSubview:_identifyNumTexField];
    
    _bottomLine2 = [UIView new];
    _bottomLine2.backgroundColor = RGBCOLOR(242, 242, 242, 1);
    [self addSubview:_bottomLine2];

    [self layoutViews];
}

-(void)layoutViews{
    
    [_nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.mas_top).offset(0);
        make.left.mas_equalTo(self.mas_left).offset(ApplicationBackGauge);
        make.size.mas_offset(CGSizeMake(41,40));
    }];
    
    [_nameTexField mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(_nameLab.mas_right);
        make.centerY.mas_equalTo(_nameLab.mas_centerY).offset(0);
        make.right.mas_equalTo(self.mas_right).offset(-ApplicationBackGauge);
    }];
    
    [_bottomLine1 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.mas_left).offset(0);
        make.right.mas_equalTo(self.mas_right).offset(0);
        make.height.mas_offset(@0.5);
        make.top.mas_equalTo(_nameLab.mas_bottom).offset(0);
    }];
    
    
    [_identifyCardLab mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(_nameLab.mas_left).offset(0);
        make.top.mas_equalTo(_bottomLine1.mas_bottom).offset(0);
        make.size.mas_equalTo(CGSizeMake(55, 40));
    }];
    
    [_identifyNumTexField mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(_identifyCardLab.mas_right).offset(0);
        make.centerY.mas_equalTo(_identifyCardLab.mas_centerY).offset(0);
        make.right.mas_equalTo(self.mas_right).offset(-ApplicationBackGauge);
    }];
    
    [_bottomLine2 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.mas_left).offset(0);
        make.right.mas_equalTo(self.mas_right).offset(0);
        make.height.mas_offset(@0.5);
        make.top.mas_equalTo(_identifyCardLab.mas_bottom).offset(0);
    }];

}




@end
